/**
 * Company : Thai Informatic System Co., Ltd.
 * Created By : Dr.Tree
 * Created On : Apr 10, 2012  3:43:14 PM 
 * e-Mail : chatree@tis.co.th
 * Mobile Phone : (+66) 087-921-5115
 * Package Name : jpa.service.promis.sales
 * File Name : VwSyncMktContrJoOwnServices.java
 * TODO
 */
package jpa.service.promis.sales;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.persistence.EntityManager;
import org.apache.log4j.Logger;
import jpa.entitys.promis.sales.VwSyncMktContrJoOwn;
import jpa.service.common.JPAService;

/**
 * @author chatree
 *
 */
public class VwSyncMktContrJoOwnServices extends JPAService {
	
	private static final Logger log = Logger.getLogger(VwSyncMktContrJoOwnServices.class);

	/**
	 * @param em
	 */
	public VwSyncMktContrJoOwnServices(EntityManager em) {
		super(em);
		// TODO Auto-generated constructor stub
	}

	public VwSyncMktContrJoOwn findById(String id) throws Exception {
		
		return super.ConvertToYoureObject(super.find(id, "VwSyncMktContrJoOwn.findById"));				
	}
	
	public List<VwSyncMktContrJoOwn> findByBookingNo(String company, String project ,String bookingDocumentNo) throws Exception {
		Map<String,Object> mapWhereValue = new HashMap<String, Object>();				
		mapWhereValue.put("company", company);
		mapWhereValue.put("project", project);
		mapWhereValue.put("bookingDocumentNo", bookingDocumentNo);
		
		return super.ConvertToYoureObject(super.find("VwSyncMktContrJoOwn.findByBookingNo", mapWhereValue));
	}
	
	public List<VwSyncMktContrJoOwn> findByContractNo(String company, String project ,String contractDocumentNo) throws Exception {
		Map<String,Object> mapWhereValue = new HashMap<String, Object>();				
		mapWhereValue.put("company", company);
		mapWhereValue.put("project", project);
		mapWhereValue.put("contractDocumentNo", contractDocumentNo);
		
		return super.ConvertToYoureObject(super.find("VwSyncMktContrJoOwn.findByContractNo", mapWhereValue));
	}
	
	
}
